package com.gewu.pm.ui.adapter.approval;

import android.content.Context;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.gewu.pm.R;
import com.gewu.pm.app.AppAdapter;

/**
 * 驳回记录
 */
public final class RejectionRecordAdapter extends AppAdapter<String> {

    public RejectionRecordAdapter(Context context) {
        super(context);
    }

    @NonNull
    @Override
    public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        return new ItemViewHolder();
    }

    private final class ItemViewHolder extends AppAdapter<?>.ViewHolder {

        private final TextView tvRejecter;//驳回人
        private final TextView tvRejectedPerson;//被驳回人
        private final TextView tvRejectionType;//驳回类型
        private final TextView tvRejectionTime;//驳回时间
        private final TextView tvRejectionOpinion;//驳回意见


        private ItemViewHolder() {
            super(R.layout.rejection_record_item);
            tvRejecter = findViewById(R.id.tv_rejecter);
            tvRejectedPerson = findViewById(R.id.tv_rejected_person);
            tvRejectionType = findViewById(R.id.tv_rejection_type);
            tvRejectionTime = findViewById(R.id.tv_rejection_time);
            tvRejectionOpinion = findViewById(R.id.tv_rejection_opinion);

        }

        @Override
        public void onBindView(int position) {
            String orderNo = getItem(position);
            // TODO: 根据实际数据设置
            tvRejecter.setText(orderNo);
            tvRejectedPerson.setText("张三");
            tvRejectionType.setText("驳回上一级");
            tvRejectionTime.setText("2025/8/18 16:40");
            tvRejectionOpinion.setText("数据有些对不上，请仔细核对");

        }
    }
}

